package net.uri;

import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;

import net.url.QueryString;

public class DMoz
{
	public static void main(String[] args)
	{
		String target = "";
		for (int i = 0; i < args.length; i++)
		{
			target+=args[i]+" ";
		}
		target = target.trim();
		QueryString query = new QueryString("search", target);
		try
		{
			URL u = new URL("http://search.domz.org/cgi-bin/search?"+query);
			InputStream in = new BufferedInputStream(u.openStream());
			InputStreamReader thrHTML = new InputStreamReader(in);
			int c;
			while((c=thrHTML.read())!=-1)
			{
				System.out.print((char)c);
			}
			
		}
		catch (Exception e)
		{
		}
	}
}
